import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/', component: () => import('@/views/login') },
  {
    path: '/layout',
    component: () => import('@/layout'),
    children: [
      {
        path: '/user',
        name: 'user',
        component: () => import('@/views/user')
      },
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home')
      },
      {
        path: '/video',
        name: 'video',
        component: () => import('@/views/video')
      },
      {
        path: '/article',
        name: 'article',
        component: () => import('@/views/article')
      }
    ]
  },
  { path: '/details', component: () => import('@/views/details') }
]

const router = new VueRouter({
  routes
})

export default router
